package cn.xval.ft.app.gen.database.entity;

import cn.xval.fc.core.database.SnowflakeIdGenerator;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
import lombok.ToString;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.GenericGenerator;

@Data
@Entity
@Table(name = "FrontHost")
@ToString
public class FrontHost {
    @Id
    @GenericGenerator(name = "Snowflake", type = SnowflakeIdGenerator.class)
    @GeneratedValue(generator = "Snowflake")
    @Comment("编码")
    @Column(name = "id")
    private Long id;
    /**
     * 方便记忆的名称
     */
    @Comment("名称")
    @Column(name = "name", nullable = false, length = 100)
    private String name;
    /**
     * 0 行情前置机
     * 1 交易前置机
     */
    @Comment("前置机类型")
    @Column(name = "frontType", nullable = false)
    private Integer frontType;
    /**
     * 0 IP
     * 1 域名
     */
    @Comment("前置解析类型")
    @Column(name = "resolveType", nullable = false)
    private Integer resolveType;
    /**
     * tcp
     * udp
     * http 等
     */
    @Comment("协议")
    @Column(name = "protocol", nullable = false, length = 20)
    private String protocol;
    /**
     * IP 或 域名
     */
    @Comment("前置机地址")
    @Column(name = "addr", nullable = false, length = 100)
    private String addr;
    @Comment("端口")
    @Column(name = "port", nullable = false)
    private Long port;
}